<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" name="referrer" content="never">
    <title>影友-电影搜索</title>
    <link rel="shortcut icon" href="images/logo.ico">
    <link rel="stylesheet" href="css/searchMovie2.css">
    <link rel="stylesheet" href="css/movieDetails.css">
    <link rel="stylesheet" href="css/searchTitle.css">
</head>
<body>
<!--    导航栏-->
    <div class="nav">
        <div class="width_1200">
            <ul>
                <li><a href="main.php">主界面</a></li>
                <li style="padding-left: 20px">
                    <form method="post" action="search_movies.php" >
                        <input type="text" name="search_keyword" placeholder="三千世界来搜一搜吧...">
                        <button type="submit" class="search"></button>
                    </form>
                </li>
                <li style="padding-left: 10px"><a href="setup_friends.php">我的好友</a></li>
                <li><a href="dialog.html">树洞聊天室</a></li>

            </ul>
            <ol>
                <li>
                    <a href="person_things_sever.php">
                        <?php echo $_SESSION['user']['username'] ?>
                    </a>
                </li>

                <li class="li_message">&nbsp;
                    <dl class="menu">
                        <dd><a href="setup_chat.php">聊天</a></dd>
                    </dl>
                </li>
                <li class="li_set">&nbsp;
                    <dl class="menu">
                        <dd><a href="person_things_sever.php">个人中心</a></dd>
                        <dd><a href="personal_label_login_sever.php">选择标签</a></dd>
                        <dd><a href="logout.php">退出</a></dd>
                    </dl>
                </li>
            </ol>
        </div>
    </div>
    <div class="big-title">
        <a href="main.php" title="影友">
            <img class="logo" src="images/logo.png">
        </a>
        <!--点击搜索把影片名/年代等关键词传给后端，然后显示结果-->
        <form method="post" id="search-form" action="search_movies.php">
                <span>
                    <input type="text" name="movies_keyword" id="movies_keyword" class="search-text"
                           placeholder="影片名 / 导演 / 编剧 / 演员 ">
                    <input type="submit" value="搜索一下" class="search-submit">
                </span>
        </form>
        <!--点击排序依据后把排序依据传给后端，然后刷新结果-->
        <form method="post" id="search-sort" action="search_movies.php">
            <ul class="sort" id="sort">
                <li>
                    <input class="sort-t" id="sort-time" type="submit" name="order_type" value="按时间排序">
                </li>
                <li>
                    <input class="sort-t" id="sort-score" type="submit" name="order_type" value="按评分排序">
                </li>
                <li>
                    <input class="sort-t" id="sort-name" type="submit" name="order_type" value="按名称排序">
                </li>
            </ul>
        </form>
        <!--点击标签，然后把标签词传给后端，然后显示结果-->
        <form method="post" id="label-form" action="search_movies.php">
            <ul class="label-all" id="label-all">
                <li class="label-single" id="label-single-1">
                    <input class="label-single" type="submit" name="movies_type" value="动作片">
                </li>
                <li class="label-single" id="label-single-2">
                    <input class="label-single" type="submit" name="movies_type" value="犯罪片">
                </li>
                <li class="label-single" id="label-single-3">
                    <input class="label-single" type="submit" name="movies_type" value="科幻片">
                </li>
                <li class="label-single" id="label-single-4">
                    <input class="label-single" type="submit" name="movies_type" value="喜剧片">
                </li>
                <li class="label-single" id="label-single-5">
                    <input class="label-single" type="submit" name="movies_type" value="爱情片">
                </li>
                <li class="label-single" id="label-single-6">
                    <input class="label-single" type="submit" name="movies_type" value="悬疑片">
                </li>
                <li class="label-single" id="label-single-7">
                    <input class="label-single" type="submit" name="movies_type" value="恐怖片">
                </li>
                <li class="label-single" id="label-single-8">
                    <input class="label-single" type="submit" name="movies_type" value="战争片">
                </li>
                <li class="label-single" id="label-single-9">
                    <input class="label-single" type="submit" name="movies_type" value="动画片">
                </li>
                <li class="label-single" id="label-single-10">
                    <input class="label-single" type="submit" name="movies_type" value="冒险片">
                </li>
                <li class="label-single" id="label-single-11">
                    <input class="label-single" type="submit" name="movies_type" value="惊悚片">
                </li>
                <li class="label-single" id="label-single-12">
                    <input class="label-single" type="submit" name="movies_type" value="奇幻片">
                </li>
                <li class="label-single" id="label-single-13">
                    <input class="label-single" type="submit" name="movies_type" value="剧情片">
                </li>
                <li class="label-single" id="label-single-14">
                    <input class="label-single" type="submit" name="movies_type" value="纪录片">
                </li>
                <li class="label-single" id="label-single-15">
                    <input class="label-single" type="submit" name="movies_type" value="灾难片">
                </li>
            </ul>
        </form>
    </div>
    <div class="label-border">
        <hr class="labelDiv">
    </div>
    <div class="movieDetail">
        <div class="bigPic">
            <img class="picMv" src="<?php echo $data['picture'] ?>" alt="影片图片">
        </div>
        <div class="bigTitle">
            <?php echo $data['name'] ?>
        </div>
        <hr class="titleDiv">
        <hr class="scoreDiv">
        <div class="score">
            <div class="totalScore">
                豆瓣评分：<span class="doubanScore"><?php echo $data['score'] ?></span>
            </div>
            <div class="fivestar">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <div class="scoreText"><?php echo $data['five-star'] ?></div>
            </div>
            <div class="fourstar">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <div class="scoreText"><?php echo $data['four-star'] ?></div>
            </div>
            <div class="threestar">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <div class="scoreText"><?php echo $data['three-star'] ?></div>
            </div>
            <div class="twostar">
                <img class="scoreStar" src="images/star.png" alt="">
                <img class="scoreStar" src="images/star.png" alt="">
                <div class="scoreText"><?php echo $data['two-star'] ?></div>
            </div>
            <div class="onestar">
                <img class="scoreStar" src="images/star.png" alt="">
                <div class="scoreText"><?php echo $data['one-star'] ?></div>
            </div>
        </div>
        <div class="detailInfo">
            <div class="director">
                导演：<?php echo $data['director'] ?>
            </div>
            <div class="screenwriter">
                编剧：<?php echo $data['screenwriter'] ?>
            </div>
            <div class="actor">
                演员：<?php echo $data['actor'] ?>
            </div>
            <div class="label">
                类型：<?php echo $data['type'] ?>
            </div>
            <div class="area">
                制片国家/地区：<?php echo $data['producing_country'] ?>
            </div>
            <div class="language">
                语言：<?php echo $data['language'] ?>
            </div>
            <div class="date">
                上映日期：<?php echo $data['release_date'] ?>
            </div>
            <div class="length">
                片长：<?php echo $data['length'] ?>min
            </div>
            <div class="doubanLink">
                豆瓣链接：<a href="<?php echo $data['link_douban'] ?>"><?php echo $data['link_douban'] ?></a>
            </div>
            <div class="IMDbLink">
                IMDb链接：<a href="<?php echo $data['link_imdb'] ?>"><?php echo $data['link_imdb'] ?></a>
            </div>
        </div>
        <div class="introduction">
            剧情简介：<?php echo $data['synopsis'] ?>
        </div>
    </div>
    <div class="recList">
        <p class="recBig">个性推荐</p>
        <?php foreach($good_movies as $row){ ?>
        <div class="recListmv">
            <div class="recSingle">
                <form method="post" action="movie_details.php" id="0<?php echo $row['Id'] ?>1">
                    <div>
                        <img class="recPic" src="<?php echo $row['picture'] ?>" alt="影片海报"  onclick="demo_hhh(this)" id="0<?php echo $row['Id'] ?>">
                    </div>
                    <div class="recTitle">
                        <input value="<?php echo $row['name'] ?>" name="movie_name" class="recTitle"  onclick="demo_hhh1(this)" id="<?php echo $row['Id'] ?>1">
                    </div>
                </form>
            </div>
        </div>
        <?php } ?>
    </div>
<script>
    function demo_hhh(e){
        document.getElementById(e.id+'1').submit();
    }
    function demo_hhh1(e){
        document.getElementById('0'+e.id).submit();
    }
</script>
</body>
</html>